﻿using SmartSapce.ServiceLocation;
using SmartSpace.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SmartSpace.WebApp._console.core
{
    public partial class privilege_add : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void _ctlBtnSave_Click(object sender, EventArgs e)
        {
            ICoreService service = ServiceLocator.Get<ICoreService>();
            Privilege privilege = new Privilege();
            privilege.Id = Guid.NewGuid();
            privilege.Type = _ctlEditType.Text;
            privilege.Code = _ctlEditCode.Text;
            privilege.Caption = _ctlEditCaption.Text;
            if (service.SavePrivilege(privilege))
            {
                Response.Redirect(_ctlLinkBack.NavigateUrl);
            }
        }
    }
}